﻿using System;
using System;
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Text;
using netDxf;
using netDxf.Blocks;
using netDxf.Collections;
using netDxf.Entities;
using netDxf.Header;
using netDxf.Objects;
using netDxf.Tables;
using netDxf.Units;
using Attribute = netDxf.Entities.Attribute;
using Image = netDxf.Entities.Image;
using Point = netDxf.Entities.Point;
using Trace = netDxf.Entities.Trace;
using System.Threading;

namespace TestDxfDocument
{

    class Solidsteppedreamer
    {
        public static void _Solidsteppedreamer(Dictionary<string, Object> data)//细柄丝锥
        {
            DxfDocument dxf = new DxfDocument();
            //图层
            Layer contour = new Layer("contour") { Color = AciColor.Cyan };    //轮廓层
            Layer dimensioning = new Layer("dimensioning");    //尺寸层
            Layer refin = new Layer("refin") { Color = AciColor.Red };    //基准线/内轮廓
            refin.Linetype = Linetype.Dashed;
            Layer centre = new Layer("centre") { Color = AciColor.Yellow };    //中心线
            Layer textlayer = new Layer("textlayer") { Color = AciColor.Blue };    //文本层
            Layer hatching = new Layer("hatching") { Color = AciColor.Blue };    //填充层
            centre.Linetype = Linetype.DashDot;
            Layer additionalline = new Layer("additionalline") { Color = AciColor.Cyan };    //附加线
            Layer cutting = new Layer("cutting") { Color = AciColor.Red };    //切削层
            Layer nocutting = new Layer("nocutting");    //非切削层
            Layer skcontour = new Layer("skcontour") { Color = AciColor.Cyan };    //sk轮廓层
            Layer skdimensioning = new Layer("skdimensioning");    //sk尺寸线层
            Layer skrefin = new Layer("skrefin") { Color = AciColor.Red };    //sk基准线/内轮廓
            Layer sktext = new Layer("sktext") { Color = AciColor.Blue };  //sk文本
            Layer skhatching = new Layer("skhatching") { Color = AciColor.Blue };    //sk填充
            Layer skadditionlline = new Layer("skadditionlline") { Color = AciColor.Cyan };    //sk附加线
            Layer skviewcontour = new Layer("skviewcontour") { Color = AciColor.Cyan };    //skview轮廓
            Layer skviewdimensioning = new Layer("skviewdimensioning");    //skview尺寸线层

            //参数
            double pi = Math.PI;
            string path = Convert.ToString(data["path"]);

            double scale = 2; //放大系数

            double oal = 38.73;
            double lpr = 29.97;
            double dc1 = 8.74;
            double dc2 = 11.32;
            double dc3 = 14.48;
            double dconms = 9.13;
            double sta1 = 60;
            double sta2 = 89;
            double sta3 = 91;
            double sd1 = 3.29;
            double sd2 = 14.66;
            double sd3 = 20.1;


            //坐标
            Vector2 v1 = new Vector2(0, 0);
            Vector2 v2 = new Vector2(v1.X + oal + 4, v1.Y);
            Vector2 v3 = new Vector2(v2.X - 2, v1.Y);
            Vector2 v5 = new Vector2(v3.X - sd1, v3.Y + dc1 / 2);
            Vector2 v4 = new Vector2(v3.X, v5.Y - sd1 * Math.Tan(sta1 / 2 * pi / 180));
            Vector2 v6 = new Vector2(v5.X - sd2 / 3.029, v5.Y);
            Vector2 v7 = new Vector2(v6.X - sd2 / 12.016, v6.Y - dc1 / 7.106);
            Vector2 v9 = new Vector2(v3.X - sd2, v3.Y + dc2 / 2);
            Vector2 v8 = new Vector2(v9.X + (v9.Y - v7.Y) / Math.Tan(sta2 / 2 * pi / 180), v7.Y);
            Vector2 v11 = new Vector2(v3.X - sd3, v3.Y + dc3 / 2);
            Vector2 v10 = new Vector2(v11.X + (v11.Y - v9.Y) / Math.Tan(sta3 / 2 * pi / 180), v9.Y);
            Vector2 v12 = new Vector2(v11.X - lpr / 11.439, v11.Y);
            Vector2 v13 = new Vector2(v12.X - lpr / 37.4625, v3.Y + dc3 / 2.231);
            Vector2 v21 = new Vector2(v3.X - lpr, v3.Y + dc3 / 1.768 - 0.5);
            Vector2 v20 = new Vector2(v21.X + 0.3, v21.Y + 0.3);
            Vector2 v19 = new Vector2(v20.X + lpr / 27, v20.Y);
            Vector2 v18 = new Vector2(v19.X + 0.3, v19.Y - 0.3);
            Vector2 v17 = new Vector2(v18.X, v3.Y + dc3 / 1.918);
            Vector2 v16 = new Vector2(v17.X + lpr / 65.152, v3.Y + dc3 / 2);
            Vector2 v15 = new Vector2(v16.X + lpr / 23.414, v16.Y);
            Vector2 v14 = new Vector2(v15.X + lpr / 42.211, v13.Y);
            Vector2 v22 = new Vector2(v21.X, v21.Y * -1);
            Vector2 v23 = new Vector2(v20.X, v20.Y * -1);
            Vector2 v24 = new Vector2(v19.X, v19.Y * -1);
            Vector2 v25 = new Vector2(v18.X, v18.Y * -1);
            Vector2 v26 = new Vector2(v17.X, v17.Y * -1);
            Vector2 v27 = new Vector2(v16.X, v16.Y * -1);
            Vector2 v28 = new Vector2(v15.X, v15.Y * -1);
            Vector2 v29 = new Vector2(v14.X, v14.Y * -1);
            Vector2 v30 = new Vector2(v13.X, v13.Y * -1);
            Vector2 v31 = new Vector2(v12.X, v12.Y * -1);
            Vector2 v32 = new Vector2(v11.X, v11.Y * -1);
            Vector2 v33 = new Vector2(v10.X, v10.Y * -1);
            Vector2 v34 = new Vector2(v9.X, v9.Y * -1);
            Vector2 v35 = new Vector2(v8.X, v8.Y * -1);
            Vector2 v36 = new Vector2(v7.X, v7.Y * -1);
            Vector2 v37 = new Vector2(v6.X, v6.Y * -1);
            Vector2 v38 = new Vector2(v5.X, v5.Y * -1);
            Vector2 v39 = new Vector2(v4.X, v4.Y * -1);
            Vector2 v40 = new Vector2(v21.X, v3.Y + dconms / 2.08);
            Vector2 v41 = new Vector2(v40.X - 0.3, v40.Y);
            Vector2 v42 = new Vector2(v41.X - 0.3, v3.Y + dconms / 2);
            Vector2 v43 = new Vector2(v3.X - oal + 0.8, v42.Y);
            Vector2 v44 = new Vector2(v43.X - 0.8, v43.Y - 0.5);
            Vector2 v45 = new Vector2(v44.X, v44.Y * -1);
            Vector2 v46 = new Vector2(v43.X, v43.Y * -1);
            Vector2 v47 = new Vector2(v42.X, v42.Y * -1);
            Vector2 v48 = new Vector2(v41.X, v41.Y * -1);
            Vector2 v49 = new Vector2(v40.X, v40.Y * -1);
            Vector2 v50 = new Vector2(v40.X, v3.Y + dconms / 2.775);
            Vector2 v51 = new Vector2(v18.X, v50.Y);
            Vector2 v52 = new Vector2(v51.X, v51.Y * -1);
            Vector2 v53 = new Vector2(v50.X, v52.Y);
            Vector2 v54 = new Vector2(v20.X, v50.Y);
            Vector2 v55 = new Vector2(v19.X, v50.Y);
            Vector2 v56 = new Vector2(v24.X, v52.Y);
            Vector2 v57 = new Vector2(v23.X, v53.Y);
            Vector2 v58 = new Vector2(v29.X, v3.Y + dc3 / 2.691);
            Vector2 v59 = new Vector2(v30.X, v3.Y + dc3 / 4.976);
            Vector2 v60 = new Vector2(v31.X, v3.Y + dc3 / 6.058);
            Vector2 v61 = new Vector2(v32.X, v3.Y + dc3 / 9.164);
            Vector2 v62 = new Vector2(v33.X, v3.Y + dc1 / 6.333);
            Vector2 v63 = new Vector2(v34.X, v62.Y);
            Vector2 v64 = new Vector2(v35.X, v63.Y);
            Vector2 v65 = new Vector2(v35.X + (v36.X - v35.X) / 2, v63.Y);
            Vector2 v66 = new Vector2(v36.X, v3.Y + (v3.X - v36.X) * (v65.Y - v3.Y) / (v3.X - v65.X));
            Vector2 v67 = new Vector2(v37.X, v3.Y + (v3.X - v37.X) * (v65.Y - v3.Y) / (v3.X - v65.X));
            Vector2 v68 = new Vector2(v38.X, v3.Y + (v3.X - v38.X) * (v65.Y - v3.Y) / (v3.X - v65.X));
            Vector2 a1 = new Vector2(v21.X, v3.Y);
            Vector2 a2 = new Vector2(v34.X - (v35.X - v34.X) / 2, v34.Y + (v35.Y - v34.Y) / 2);

            Vector2 v69 = new Vector2(v2.X + oal / 2.069, v2.Y);
            Vector2 v70 = new Vector2(v69.X + oal / 16.273 + 2, v2.Y);
            Vector2 v71 = new Vector2(v69.X + 1, v69.Y);
            Vector2 v72 = new Vector2(v71.X, v71.Y + dc3 / 3.81);
            Vector2 v73 = new Vector2(v72.X + oal / 16.273 / 3, v72.Y);
            Vector2 v74 = new Vector2(v73.X + oal / 16.273 / 3, v73.Y);
            Vector2 v75 = new Vector2(v72.X + oal / 16.273, v72.Y);
            Vector2 v76 = new Vector2(v75.X, v75.Y * -1);
            Vector2 v77 = new Vector2(v74.X, v74.Y * -1);
            Vector2 v78 = new Vector2(v73.X, v73.Y * -1);
            Vector2 v79 = new Vector2(v72.X, v72.Y * -1);
            Vector2 v80 = new Vector2(v71.X, v71.Y + dc3 / 5.569);
            Vector2 v81 = new Vector2(v75.X, v80.Y);
            Vector2 v83 = new Vector2(v81.X, v81.Y * -1);
            Vector2 v82 = new Vector2(v80.X, v83.Y);

            






            //作图
            Line line1 = new Line(v1, v2);
            line1.Layer = centre;
            line1.Linetype = Linetype.DashDot;
            line1.LinetypeScale = 3;
            dxf.AddEntity(line1);

            LwPolyline line2 = new LwPolyline();
            line2.Vertexes.Add(new LwPolylineVertex(v4));
            line2.Vertexes.Add(new LwPolylineVertex(v5));
            line2.Vertexes.Add(new LwPolylineVertex(v6));   
            line2.Vertexes.Add(new LwPolylineVertex(v7));
            line2.Vertexes.Add(new LwPolylineVertex(v8));
            line2.Vertexes.Add(new LwPolylineVertex(v9));
            line2.Vertexes.Add(new LwPolylineVertex(v10));
            line2.Vertexes.Add(new LwPolylineVertex(v11));
            line2.Vertexes.Add(new LwPolylineVertex(v12));
            line2.Vertexes.Add(new LwPolylineVertex(v13));
            line2.Vertexes.Add(new LwPolylineVertex(v14));
            line2.Vertexes.Add(new LwPolylineVertex(v15));
            line2.Vertexes.Add(new LwPolylineVertex(v16));
            line2.Vertexes.Add(new LwPolylineVertex(v17));
            line2.Vertexes.Add(new LwPolylineVertex(v18));
            line2.Vertexes.Add(new LwPolylineVertex(v19));
            line2.Vertexes.Add(new LwPolylineVertex(v20));
            line2.Vertexes.Add(new LwPolylineVertex(v21));
            line2.Vertexes.Add(new LwPolylineVertex(v22));
            line2.Vertexes.Add(new LwPolylineVertex(v23));
            line2.Vertexes.Add(new LwPolylineVertex(v24));
            line2.Vertexes.Add(new LwPolylineVertex(v25));
            line2.Vertexes.Add(new LwPolylineVertex(v26));
            line2.Vertexes.Add(new LwPolylineVertex(v27));
            line2.Vertexes.Add(new LwPolylineVertex(v28));
            line2.Vertexes.Add(new LwPolylineVertex(v29));
            line2.Vertexes.Add(new LwPolylineVertex(v30));
            line2.Vertexes.Add(new LwPolylineVertex(v31));
            line2.Vertexes.Add(new LwPolylineVertex(v32));
            line2.Vertexes.Add(new LwPolylineVertex(v33));
            line2.Vertexes.Add(new LwPolylineVertex(v34));
            line2.Vertexes.Add(new LwPolylineVertex(v35));
            line2.Vertexes.Add(new LwPolylineVertex(v36));
            line2.Vertexes.Add(new LwPolylineVertex(v37));
            line2.Vertexes.Add(new LwPolylineVertex(v38));
            line2.Vertexes.Add(new LwPolylineVertex(v39));
            line2.Vertexes.Add(new LwPolylineVertex(v4));
            fun.PolyFill(dxf, line2, 0.2, contour);

            LwPolyline line3 = new LwPolyline();
            line3.Vertexes.Add(new LwPolylineVertex(v43));
            line3.Vertexes.Add(new LwPolylineVertex(v46));
            line3.Vertexes.Add(new LwPolylineVertex(v45));
            line3.Vertexes.Add(new LwPolylineVertex(v44));
            line3.Vertexes.Add(new LwPolylineVertex(v43));
            line3.Vertexes.Add(new LwPolylineVertex(v42));
            line3.Vertexes.Add(new LwPolylineVertex(v47));
            line3.Vertexes.Add(new LwPolylineVertex(v46));
            fun.PolyFill(dxf, line3, 0.2, contour);

            LwPolyline line4 = new LwPolyline();
            line4.Vertexes.Add(new LwPolylineVertex(v41));
            line4.Vertexes.Add(new LwPolylineVertex(v48));
            line4.Vertexes.Add(new LwPolylineVertex(v47));
            line4.Vertexes.Add(new LwPolylineVertex(v42));
            line4.Vertexes.Add(new LwPolylineVertex(v41));
            line4.Vertexes.Add(new LwPolylineVertex(v40));
            line4.Vertexes.Add(new LwPolylineVertex(v49));
            line4.Vertexes.Add(new LwPolylineVertex(v48));
            fun.PolyFill(dxf, line4, 0.2, contour);

            LwPolyline line5 = new LwPolyline();
            line5.Vertexes.Add(new LwPolylineVertex(v50));
            line5.Vertexes.Add(new LwPolylineVertex(v51));
            line5.Vertexes.Add(new LwPolylineVertex(v53));
            line5.Vertexes.Add(new LwPolylineVertex(v52));
            line5.Vertexes.Add(new LwPolylineVertex(v50));
            line5.Vertexes.Add(new LwPolylineVertex(v53));
            fun.PolyFill(dxf, line5, 0.2, contour);

            LwPolyline line6 = new LwPolyline();
            line6.Vertexes.Add(new LwPolylineVertex(v20));
            line6.Vertexes.Add(new LwPolylineVertex(v54));
            line6.Vertexes.Add(new LwPolylineVertex(v55));
            line6.Vertexes.Add(new LwPolylineVertex(v19));
            line6.Vertexes.Add(new LwPolylineVertex(v18));
            line6.Vertexes.Add(new LwPolylineVertex(v25));
            line6.Vertexes.Add(new LwPolylineVertex(v24));
            line6.Vertexes.Add(new LwPolylineVertex(v56));
            line6.Vertexes.Add(new LwPolylineVertex(v57));
            line6.Vertexes.Add(new LwPolylineVertex(v23));
            fun.PolyFill(dxf, line6, 0.2, contour);

            Arc c1 = fun.DrawArc3(v15, v58, v59);
            fun.drawBArc(dxf, c1, 0.2, contour);

            Arc c2 = fun.DrawArc3(v59, v60, v61);
            fun.drawBArc(dxf, c2, 0.2, contour);

            LwPolyline line7 = new LwPolyline();
            line7.Vertexes.Add(new LwPolylineVertex(v16));
            line7.Vertexes.Add(new LwPolylineVertex(v27));
            line7.Vertexes.Add(new LwPolylineVertex(v28));
            line7.Vertexes.Add(new LwPolylineVertex(v15));
            fun.PolyFill(dxf, line7, 0.2, contour);

            LwPolyline line8 = new LwPolyline();
            line8.Vertexes.Add(new LwPolylineVertex(v58));
            line8.Vertexes.Add(new LwPolylineVertex(v29));
            line8.Vertexes.Add(new LwPolylineVertex(v30));
            line8.Vertexes.Add(new LwPolylineVertex(v59));
            fun.PolyFill(dxf, line8, 0.2, contour);

            LwPolyline line9 = new LwPolyline();
            line9.Vertexes.Add(new LwPolylineVertex(v60));
            line9.Vertexes.Add(new LwPolylineVertex(v31));
            line9.Vertexes.Add(new LwPolylineVertex(v32));
            line9.Vertexes.Add(new LwPolylineVertex(v61));
            line9.Vertexes.Add(new LwPolylineVertex(v62));
            line9.Vertexes.Add(new LwPolylineVertex(v65));
            line9.Vertexes.Add(new LwPolylineVertex(v3));
            fun.PolyFill(dxf, line9, 0.2, contour);

            LwPolyline line10 = new LwPolyline();
            line10.Vertexes.Add(new LwPolylineVertex(v62));
            line10.Vertexes.Add(new LwPolylineVertex(v33));
            line10.Vertexes.Add(new LwPolylineVertex(v34));
            line10.Vertexes.Add(new LwPolylineVertex(v63));
            line10.Vertexes.Add(new LwPolylineVertex(v64));
            line10.Vertexes.Add(new LwPolylineVertex(v35));
            line10.Vertexes.Add(new LwPolylineVertex(v36));
            line10.Vertexes.Add(new LwPolylineVertex(v66));
            line10.Vertexes.Add(new LwPolylineVertex(v67));
            line10.Vertexes.Add(new LwPolylineVertex(v37));
            line10.Vertexes.Add(new LwPolylineVertex(v38));
            line10.Vertexes.Add(new LwPolylineVertex(v68));
            fun.PolyFill(dxf, line10, 0.2, contour);

            fun.drawcircle(dxf, v38, 1, 0.1, dimensioning);

            //2
            LwPolyline line11 = new LwPolyline();
            line11.Vertexes.Add(new LwPolylineVertex(v72));
            line11.Vertexes.Add(new LwPolylineVertex(v73));
            line11.Vertexes.Add(new LwPolylineVertex(v74));
            line11.Vertexes.Add(new LwPolylineVertex(v75));
            line11.Vertexes.Add(new LwPolylineVertex(v76));
            line11.Vertexes.Add(new LwPolylineVertex(v77));
            line11.Vertexes.Add(new LwPolylineVertex(v78));
            line11.Vertexes.Add(new LwPolylineVertex(v79));
            line11.Vertexes.Add(new LwPolylineVertex(v72));
            line11.Vertexes.Add(new LwPolylineVertex(v80));
            line11.Vertexes.Add(new LwPolylineVertex(v81));
            line11.Vertexes.Add(new LwPolylineVertex(v83));
            line11.Vertexes.Add(new LwPolylineVertex(v82));
            line11.Vertexes[0].Bulge = Math.Tan(69 * pi / 180 / 4);
            line11.Vertexes[1].Bulge = Math.Tan(-79 * pi / 180 / 4);
            line11.Vertexes[2].Bulge = Math.Tan(79 * pi / 180 / 4);
            line11.Vertexes[4].Bulge = Math.Tan(79 * pi / 180 / 4);
            line11.Vertexes[5].Bulge = Math.Tan(-79 * pi / 180 / 4);
            line11.Vertexes[6].Bulge = Math.Tan(69 * pi / 180 / 4);
            fun.PolyFill(dxf, line11, 0.2, contour);



            //填充
            LwPolyline hatchpoly1 = new LwPolyline();
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v72));
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v73));
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v74));
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v75));
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v81));
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v80));
            hatchpoly1.Vertexes.Add(new LwPolylineVertex(v72));
            hatchpoly1.Vertexes[0].Bulge = Math.Tan(69 * pi / 180 / 4);
            hatchpoly1.Vertexes[1].Bulge = Math.Tan(-79 * pi / 180 / 4);
            hatchpoly1.Vertexes[2].Bulge = Math.Tan(79 * pi / 180 / 4);
            hatchpoly1.IsClosed = true;
            String[] htype1 = new String[100];
            Line[] hline1 = new Line[100];
            Arc[] harc1 = new Arc[100];
            int hnumst1 = hatchpoly1.Explode().Count;  //记录爆炸后，线段有多少
            for (int i = 0; i < hnumst1; i++)
            {
                htype1[i] = hatchpoly1.Explode()[i].Type.ToString();    //将所有的元素记录成一个数组
                if (htype1[i] == "Line")
                {
                    hline1[i] = (Line)hatchpoly1.Explode()[i];
                }
                if (htype1[i] == "Arc")
                {
                    harc1[i] = (Arc)hatchpoly1.Explode()[i];
                }
            }
            fun.hatchsub1(dxf, htype1, hnumst1, 45, 10, hline1, harc1, hatching);

            LwPolyline hatchpoly2 = new LwPolyline();
            hatchpoly2.Vertexes.Add(new LwPolylineVertex(v76));
            hatchpoly2.Vertexes.Add(new LwPolylineVertex(v77));
            hatchpoly2.Vertexes.Add(new LwPolylineVertex(v78));
            hatchpoly2.Vertexes.Add(new LwPolylineVertex(v79));
            hatchpoly2.Vertexes.Add(new LwPolylineVertex(v82));
            hatchpoly2.Vertexes.Add(new LwPolylineVertex(v83));
            hatchpoly2.Vertexes.Add(new LwPolylineVertex(v76));
            hatchpoly2.Vertexes[0].Bulge = Math.Tan(79 * pi / 180 / 4);
            hatchpoly2.Vertexes[1].Bulge = Math.Tan(-79 * pi / 180 / 4);
            hatchpoly2.Vertexes[2].Bulge = Math.Tan(69 * pi / 180 / 4);
            hatchpoly2.IsClosed = true;
            String[] htype2 = new String[100];
            Line[] hline2 = new Line[100];
            Arc[] harc2 = new Arc[100];
            int hnumst2 = hatchpoly2.Explode().Count;  //记录爆炸后，线段有多
                                                       //
                                                       //少
            for (int i = 0; i < hnumst2; i++)
            {
                htype2[i] = hatchpoly2.Explode()[i].Type.ToString();    //将所有的元素记录成一个数组
                if (htype2[i] == "Line")
                {
                    hline2[i] = (Line)hatchpoly2.Explode()[i];
                }
                if (htype2[i] == "Arc")
                {
                    harc2[i] = (Arc)hatchpoly2.Explode()[i];
                }
            }
            fun.hatchsub1(dxf, htype2, hnumst2, 45, 10, hline2, harc2, hatching);


            //坐标系
            fun.Axis(dxf, a1, -90, 180, "", "", "PCS,MCS", 0.5, 2, 0);

            fun.Axis(dxf, v3, -90, 180, "", "", "CIP", 0.5, 2, 0);


            //标注

            double height = 2;
            double arrowsize = 2;
            double exline = 2;



            fun.dimrot1(dxf, v21, v5, 0, dconms, 1, height, arrowsize, exline, "LF,LTA", "", "");

            fun.dimrot1(dxf, v5, v4, 0, dconms + (v21.Y + v5.Y) / 2 - (v5.Y + v4.Y) / 2, 1, height, arrowsize, exline, "PLGL", "", "");

            fun.dimrot1(dxf, v43, v46, 90, dconms / 2, 1, height, arrowsize, exline, "DCONMS", "", "");

            fun.dimrot1(dxf, v39, v4, -90, dconms / 2, 1, height, arrowsize, exline, "DCINTF", "", "");

            fun.dimrot1(dxf, v38, v5, -90, dconms * 1.5, 1, height, arrowsize, exline, "DC_1", "", "");

            fun.dimrot1(dxf, v34, v9, -90, dconms * 3.25, 1, height, arrowsize, exline, "DC_2", "", "");

            fun.dimrot1(dxf, v32, v11, -90, dconms * 4.5, 1, height, arrowsize, exline, "DC_3", "", "");

            fun.dimrot1(dxf, v38, v39, 180, dconms, 1, height, arrowsize, exline, "SD_1", "", "");

            fun.dimrot1(dxf, v38, a2, 180, dconms - (v39.Y + v38.Y) / 2  + (v38.Y + a2.Y) / 2, 1, height, arrowsize, exline, "SDL_1", "", "");

            fun.dimrot1(dxf, v34, v39, 180, dconms * 2, 1, height, arrowsize, exline, "SD_2", "", "");

            fun.dimrot1(dxf, v34, v33, 180, dconms * 1.5 - (v34.Y + v39.Y) / 2 + (v34.Y + v33.Y) / 2, 1, height, arrowsize, exline, "SDL_2", "", "");

            fun.dimrot1(dxf, v32, v39, 180, dconms * 2.5, 1, height, arrowsize, exline, "SD_3", "", "");

            fun.dimrot1(dxf, new Vector2(v29.X + (v30.X - v29.X) / 2, v29.Y), v39, 180, dconms * 3, 1, height, arrowsize, exline, "LU", "", "");

            fun.dimrot1(dxf, v22, v39, 180, dconms * 3.5, 1, height, arrowsize, exline, "LPR", "", "");

            fun.dimrot1(dxf, v45, v22, 180, dconms * 3.5 - (v39.Y + v22.Y) / 2 + (v45.Y + v22.Y) / 2, 1, height, arrowsize, exline, "LS", "", "");

            fun.dimrot1(dxf, v45, v39, 180, dconms * 4.5, 1, height, arrowsize, exline, "OAL", "", "");

            fun.jdbz2(dxf, new Line(v5, fun.Polar(v5, (180-sta1 /2) * pi / 180, 0.1)), new Line(v38, fun.Polar(v38, (sta1 /2-180) * pi / 180, 0.1)), sd2/2, height, arrowsize, exline, "STA_1", "", "");

            fun.jdbz2(dxf, new Line(v5, fun.Polar(v5, (180 - sta1 / 2) * pi / 180, 0.1)), new Line(v3, fun.Polar(v3, 180 * pi / 180, 0.1)), sd2 / 1.5, height, arrowsize, exline, "PLGANG", "", "");

            fun.jdbz2(dxf, new Line(v9, fun.Polar(v9, (180 - sta2 / 2) * pi / 180, 0.1)), new Line(v34, fun.Polar(v34, (sta2 / 2 - 180) * pi / 180, 0.1)), sd2 / 2, height, arrowsize, exline, "STA_2", "", "");

            fun.jdbz2(dxf, new Line(v11, fun.Polar(v11, (180 - sta3 / 2) * pi / 180, 0.1)), new Line(v32, fun.Polar(v32, (sta3 / 2 - 180) * pi / 180, 0.1)), sd2, height, arrowsize, exline, "STA_3", "", "");

            fun.text1(dxf, new Vector2(v38.X + oal / 52.338, v38.Y - dc1 / 2.648), 90, "CRP");

            fun.jt(dxf, new Vector2(v2.X + oal / 3.327, v2.Y - dc1 / 0.395), 180, 9, height, "FDP");

            fun.jt(dxf, new Vector2(v42.X - (oal-lpr) / 2, v42.Y), 100, 9, height, "CCMS");

            //2
            fun.dimrot1(dxf, v81, v83, -90, dconms, 1, height, arrowsize, exline, "PHD", "", "");






            //定义格式，路径导出
            dxf.DrawingVariables.AcadVer = DxfVersion.AutoCad2007;
            dxf.Save(path);


        }

    }
}